package com.mvp.lt.airlineview.location;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.mvp.lt.airlineview.LocationSearchBean;
import com.mvp.lt.airlineview.R;

import java.util.List;

/**
 * $activityName
 *
 * @author LiuTao
 * @date 2019/3/21/021
 */


public class LocationPositionAdapter extends BaseQuickAdapter<LocationSearchBean, BaseViewHolder> {
    private int selectedId = -1;

    public LocationPositionAdapter(List<LocationSearchBean> data) {
        super(R.layout.item_locatopn_search_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, LocationSearchBean item) {
        TextView poi_field_id = helper.getView(R.id.poi_field_id);
        TextView poi_value_id = helper.getView(R.id.poi_value_id);
        poi_field_id.setText(item.getName());
        poi_value_id.setText(item.getAddress());
    }

    public void setSelectedId(int selectedId) {
        this.selectedId = selectedId;
        notifyDataSetChanged();
    }
}
